<template>
	<view class="header">
        <!-- <view class="title">
             <select style="color: #666666;border: 0;font-size: 28upx;" class="input">
                          <option>全部订单</option>
                          <option>已完成</option>
                          <option>未完成</option>
                          <option>待付款</option>
            </select>
            <span>全部订单</span>
        </view> -->
		<view class="uni-card" v-for="(item,index) in result" :key="index">
			<view class="box">
				<text style="flex: 1;white-space: nowrap;">{{item.orderId}}</text>
				<text v-if='item.status === 0' style="color: #D7000F;">未结算</text>
				<text v-if='item.status === 1' style="color: #D7000F;">已结算</text>
			</view>
			<view class="pox">
				<image class="img" :src="item.image"></image>
				<view class="txt">
					<view>商品名称:{{item.name}}</view>
					<view style="color: #666;">购买日期:{{item.ctime}}</view>
					<view style="color: #666;">{{item.username}}</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
import { get,post,showToast } from '../../js/common';
export default {
	data() {
		return {
			userId:'',
			page:'',
			limit:'',
			result:[]
		}
	},
	onLoad() {
		this.getshowDisOrder()
	},
	methods:{
		getshowDisOrder() {
			try {
				this.userId = uni.getStorageSync('userId')
				const params = {
					userId: this.userId,
					page:this.page,
					limit:this.limit
				}
				post('mobileapi/pcdis/showDisOrder', params).then(res => {
					this.result = res.result
				})
			} catch (e) {}
		},
	}
}
</script>
<style>
	.header{
		font-size: 28upx;
	}
	.title{
		display: flex;
		justify-content: space-between;
		height: 60upx;
		line-height: 60upx;
		margin: 20upx;
	}
	.uni-card{
		background: #ffffff;
		margin-top: 20upx;
	}
	.box{
		display: flex;
		height: 100upx;
		line-height: 120upx;
		justify-content: space-between;
		padding: 0 20upx;
		border-top: 1px solid #eee;
		border-bottom: 1px solid #eee;
	}
	.pox{
		display: flex;
	}
	.img{
		margin: 20upx;
		width: 160upx;
		height: 160upx;
		border-radius: 50%;
	}
	.txt{
		flex:1;
		margin: 40upx;
	}
</style>
